import { request } from "@/utils/request";

export const GetMedicines = async (params: any) => {
    return await request({
        url: '/api/medicine',
        method: 'get',
        params
    })
}

export const AddMedicine = async (data: any) => {
    return await request({
        url: '/api/medicine',
        method: 'post',
        data
    })
}

export const UpdateMedicine = async (id: number, data: any) => {
    return await request({
        url: `/api/medicine/${id}`,
        method: 'put',
        data
    })
}

export const DeleteMedicine = async (id: number) => {
    return await request({
        url: `/api/medicine/${id}`,
        method: 'delete'
    })
}